//
//  DYTingcheBottomView.swift
//  SheYangBigData
//
//  Created by 宋海胜 on 2021/1/6.
//  Copyright © 2021 叁拾叁. All rights reserved.
//


import UIKit

class DYTingcheBottomView: SYBaseView{
    
    
    

    var bgView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = UIColor(hex: 0x367FF6)
        v.layer.cornerRadius = 2
        return v
    }()
    
    let nameLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x1E1E1E)
        v.font = 17.autoBoldFontSize()
        v.text = "P1停车场"
        return v
    }()
    
    let total: UIImageView = {
        let v: UIImageView = UIImageView()
        v.backgroundColor = .white
        v.image = UIImage(named: "chewei_total")
//        v.layer.cornerRadius = 6
        return v
    }()
    
    let remain: UIImageView = {
        let v: UIImageView = UIImageView()
        v.backgroundColor = .white
        v.image = UIImage(named: "chewei_remain")
//        v.layer.cornerRadius = 6
        return v
    }()
    
    let totalLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor.white
        v.font = 15.autoFontSize()
        v.text = "总车位"
        
        return v
    }()
    
    let remainLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor.white
        v.font = 15.autoFontSize()
        v.text = "剩余车位"
        
        return v
    }()
    
    let totalNumLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x3B4FD4)
        v.font = 19.autoBoldFontSize()
        v.text = "100"
        
        return v
    }()
    
    let remainNumLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x5D50DC)
        v.font = 19.autoBoldFontSize()
        v.text = "21"
        
        return v
    }()
    
    var bgSecView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = UIColor(hex: 0x367FF6)
        v.layer.cornerRadius = 2
        return v
    }()
    
    let nameSecLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x1E1E1E)
        v.font = 17.autoBoldFontSize()
        v.text = "收费标准"
        return v
    }()
    
    var sepView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = Constant.bgViewColor
        return v
    }()
    
    let baiLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 14.autoFontSize()
        v.text = "白天："
        
        return v
    }()
    
    let heiLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 14.autoFontSize()
        v.text = "夜晚："
        
        return v
    }()
    
    let baiPriceLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x367FF6)
        v.font = 13.autoFontSize()
        v.text = "2元/1小时(08:00-20:00)"
        
        return v
    }()
    
    let heiPriceLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x367FF6)
        v.font = 13.autoFontSize()
        v.text = "1元/2小时(20:00-08:00)"
        
        return v
    }()
    
    public func configureView() {
        
    }
    
    override func initViews() {
        
        self.backgroundColor = .white
        addSubview(nameLb)
        addSubview(bgView)
        addSubview(total)
        addSubview(remain)
        addSubview(totalLb)
        addSubview(remainLb)
        addSubview(totalNumLb)
        addSubview(remainNumLb)
        addSubview(sepView)
        
        addSubview(nameSecLb)
        addSubview(bgSecView)
        
        addSubview(baiLb)
        addSubview(baiPriceLb)
        addSubview(heiLb)
        addSubview(heiPriceLb)
        
        addSubview(lineView)
        
        bgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(16.0.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(14.5))
            make.width.equalTo(4.0.autoWidth())
            make.height.equalTo(15.0.autoWidth())
        }
        nameLb.snp.makeConstraints { (make) in
            make.centerY.equalTo(bgView)
            make.left.equalTo(bgView.snp.right).offset(autoWidth(7.0))
            make.right.equalToSuperview().offset(autoWidth(-15.0))
            make.height.equalTo(16.0.autoWidth())
        }
        total.snp.makeConstraints { (make) in
            make.top.equalTo(nameLb.snp.bottom).offset(autoWidth(15.0))
            make.left.equalToSuperview().offset(13.0.autoWidth())
            make.height.equalTo(85.0.autoWidth())
            make.width.equalTo(169.0.autoWidth())
        }
        remain.snp.makeConstraints { (make) in
            make.top.equalTo(nameLb.snp.bottom).offset(autoWidth(15.0))
            make.right.equalToSuperview().offset(-13.0.autoWidth())
            make.height.equalTo(85.0.autoWidth())
            make.width.equalTo(169.0.autoWidth())
        }
        totalLb.snp.makeConstraints { (make) in
            make.top.equalTo(total).offset(autoWidth(23.0))
            make.left.equalTo(total).offset(21.0.autoWidth())
            make.height.equalTo(15.0.autoWidth())
            
        }
        remainLb.snp.makeConstraints { (make) in
            make.top.equalTo(remain).offset(autoWidth(23.0))
            make.left.equalTo(remain).offset(21.0.autoWidth())
            make.height.equalTo(15.0.autoWidth())
        }
        totalNumLb.snp.makeConstraints { (make) in
            make.bottom.equalTo(total).offset(autoWidth(-18.0))
            make.left.equalTo(total).offset(29.0.autoWidth())
            make.height.equalTo(15.0.autoWidth())
        }
        remainNumLb.snp.makeConstraints { (make) in
            make.bottom.equalTo(remain).offset(autoWidth(-18.0))
            make.left.equalTo(remain).offset(29.0.autoWidth())
            make.height.equalTo(15.0.autoWidth())
        }
        
        
        
        
        bgSecView.snp.makeConstraints { (make) in
            make.top.equalTo(sepView.snp.bottom).offset(15.0.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(14.5))
            make.width.equalTo(4.0.autoWidth())
            make.height.equalTo(15.0.autoWidth())
        }
        nameSecLb.snp.makeConstraints { (make) in
            make.centerY.equalTo(bgSecView)
            make.left.equalTo(bgSecView.snp.right).offset(autoWidth(7.0))
            make.right.equalToSuperview().offset(autoWidth(-15.0))
            make.height.equalTo(16.0.autoWidth())
        }
        baiLb.snp.makeConstraints { (make) in
            make.top.equalTo(nameSecLb.snp.bottom).offset(20.0.autoWidth())
            make.left.equalTo(self).offset(autoWidth(16.0))
            make.height.equalTo(20.0.autoWidth())
            make.width.equalTo(40.0.autoWidth())
        }
        baiPriceLb.snp.makeConstraints { (make) in
            make.top.equalTo(nameSecLb.snp.bottom).offset(20.0.autoWidth())
            make.left.equalTo(baiLb.snp.right).offset(autoWidth(7.0))
            make.right.equalTo(self).offset(autoWidth(-16.0))
            make.height.equalTo(20.0.autoWidth())
        }
        lineView.snp.makeConstraints { (make) in
            make.bottom.equalTo(baiLb.snp.bottom).offset(10.0.autoWidth())
            make.left.right.equalToSuperview()
            make.height.equalTo(0.5.autoWidth())
        }
        heiLb.snp.makeConstraints { (make) in
            make.top.equalTo(lineView.snp.bottom).offset(10.0.autoWidth())
            make.left.equalTo(self).offset(autoWidth(16.0))
            make.height.equalTo(20.0.autoWidth())
            make.width.equalTo(40.0.autoWidth())
        }
        heiPriceLb.snp.makeConstraints { (make) in
            make.top.equalTo(baiLb.snp.bottom).offset(20.0.autoWidth())
            make.left.equalTo(baiLb.snp.right).offset(autoWidth(7.0))
            make.right.equalTo(self).offset(autoWidth(-16.0))
            make.height.equalTo(20.0.autoWidth())
        }
        
        sepView.snp.makeConstraints { (make) in
            make.top.equalTo(total.snp.bottom).offset(autoWidth(15.5))
            make.left.right.equalToSuperview()
            make.height.equalTo(10.0.autoWidth())
        }
        
    }
    
    
}


